/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * HomePanel.java
 *
 * Created on May 7, 2011, 11:19:47 AM
 */

package gui;

import client.Request;
import classes.User;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author mayakreidieh
 */
public class HomePanel extends javax.swing.JPanel {

    Request Client;
    User User;
    /** Creates new form HomePanel */
    public HomePanel(User user, Request client) {

        Client = client;
        User = user;

        initComponents();
        this.setSize(620,500);
        String[] tokens = null;
        //To get today's games use Field = 5 with current date
  //      Calendar curr = Calendar.getInstance();
   //     SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
    //    String datenow = formatter.format(curr.getTime());
  //      System.out.println("Formatter: "+datenow);

        String datenow = "2010-09-14";
        tokens = Client.getGames("Date", datenow);

        for (String i: tokens) {
            System.out.println(i);
        }
        fillGames(tokens);

        /* Get current games to display them
         * If no games are played today, gets the next games to be played
         */

        //GET TODAY
/*        Client.getSpecificGames("date", "today", tokens);
        //If empty
        Client.getSpecificGames("date", "> today", tokens);
        fillGames(tokens);

*/


    }


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSeparator4 = new javax.swing.JSeparator();
        jSeparator5 = new javax.swing.JSeparator();
        jSeparator7 = new javax.swing.JSeparator();
        jSeparator9 = new javax.swing.JSeparator();
        jSeparator11 = new javax.swing.JSeparator();
        jPanel1 = new HomeSidebar(User,Client);
        jLabel10 = new TransparentButton(0.85f);
        jScrollPane1 = new javax.swing.JScrollPane(Scrollable);
        Scrollable = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        panel3 = new javax.swing.JPanel();
        team15 = new javax.swing.JLabel();
        loc3 = new javax.swing.JLabel();
        ref3 = new javax.swing.JLabel();
        pic23 = new javax.swing.JLabel();
        pic13 = new javax.swing.JLabel();
        jSeparator6 = new javax.swing.JSeparator();
        team16 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        panel2 = new javax.swing.JPanel();
        team13 = new javax.swing.JLabel();
        loc2 = new javax.swing.JLabel();
        ref2 = new javax.swing.JLabel();
        pic22 = new javax.swing.JLabel();
        pic12 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        team14 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        panel1 = new javax.swing.JPanel();
        team11 = new javax.swing.JLabel();
        loc1 = new javax.swing.JLabel();
        ref1 = new javax.swing.JLabel();
        pic21 = new javax.swing.JLabel();
        pic11 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        team12 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        panel4 = new javax.swing.JPanel();
        team17 = new javax.swing.JLabel();
        loc4 = new javax.swing.JLabel();
        ref4 = new javax.swing.JLabel();
        pic24 = new javax.swing.JLabel();
        pic14 = new javax.swing.JLabel();
        jSeparator8 = new javax.swing.JSeparator();
        team18 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        panel5 = new javax.swing.JPanel();
        team19 = new javax.swing.JLabel();
        loc5 = new javax.swing.JLabel();
        ref5 = new javax.swing.JLabel();
        pic25 = new javax.swing.JLabel();
        pic15 = new javax.swing.JLabel();
        jSeparator10 = new javax.swing.JSeparator();
        team20 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        panel6 = new javax.swing.JPanel();
        team21 = new javax.swing.JLabel();
        loc6 = new javax.swing.JLabel();
        ref6 = new javax.swing.JLabel();
        pic26 = new javax.swing.JLabel();
        pic16 = new javax.swing.JLabel();
        jSeparator12 = new javax.swing.JSeparator();
        team22 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        panel7 = new javax.swing.JPanel();
        team23 = new javax.swing.JLabel();
        loc7 = new javax.swing.JLabel();
        ref7 = new javax.swing.JLabel();
        pic27 = new javax.swing.JLabel();
        pic17 = new javax.swing.JLabel();
        jSeparator13 = new javax.swing.JSeparator();
        team24 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        panel8 = new javax.swing.JPanel();
        team25 = new javax.swing.JLabel();
        loc8 = new javax.swing.JLabel();
        ref8 = new javax.swing.JLabel();
        pic28 = new javax.swing.JLabel();
        pic18 = new javax.swing.JLabel();
        jSeparator14 = new javax.swing.JSeparator();
        team26 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new TransparentButton(0.75f);
        jLabel12 = new TransparentButton(0.85f);
        jPanel2 = new javax.swing.JPanel();

        setBackground(new java.awt.Color(0, 51, 204));
        setOpaque(false);
        setLayout(null);
        add(jPanel1);
        jPanel1.setBounds(750, 80, 320, 660);

        jLabel10.setBackground(new java.awt.Color(0, 0, 0));
        jLabel10.setText("jLabel10");
        jLabel10.setOpaque(true);
        add(jLabel10);
        jLabel10.setBounds(740, 70, 340, 1400);

        jScrollPane1.setBorder(null);
        jScrollPane1.setOpaque(false);

        Scrollable.setOpaque(false);
        Scrollable.setPreferredSize(new java.awt.Dimension(620, 1200));
        Scrollable.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel3.setFont(new java.awt.Font("Helvetica", 1, 24));
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Current Games");
        Scrollable.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 30, 180, 30));

        panel3.setBackground(new java.awt.Color(255, 255, 255));
        panel3.setOpaque(false);
        panel3.setLayout(null);

        team15.setBackground(new java.awt.Color(255, 255, 255));
        team15.setFont(new java.awt.Font("Helvetica", 1, 14));
        team15.setForeground(new java.awt.Color(204, 204, 255));
        team15.setText("Team 1");
        team15.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team15.setAlignmentX(1.0F);
        panel3.add(team15);
        team15.setBounds(240, 10, 170, 15);

        loc3.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc3.setForeground(new java.awt.Color(153, 153, 153));
        loc3.setText("Location :");
        panel3.add(loc3);
        loc3.setBounds(110, 40, 200, 13);

        ref3.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref3.setForeground(new java.awt.Color(153, 153, 153));
        ref3.setText("Referree :");
        panel3.add(ref3);
        ref3.setBounds(110, 70, 200, 13);

        pic23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic23.setText("jLabel7");
        panel3.add(pic23);
        pic23.setBounds(380, 20, 60, 70);

        pic13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic13.setText("jLabel7");
        panel3.add(pic13);
        pic13.setBounds(10, 20, 60, 70);
        panel3.add(jSeparator6);
        jSeparator6.setBounds(-10, 90, 470, 12);

        team16.setBackground(new java.awt.Color(255, 255, 255));
        team16.setFont(new java.awt.Font("Helvetica", 1, 14));
        team16.setForeground(new java.awt.Color(204, 204, 255));
        team16.setText("Team 1");
        team16.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team16.setAlignmentX(1.0F);
        panel3.add(team16);
        team16.setBounds(40, 10, 170, 15);

        jLabel8.setBackground(new java.awt.Color(255, 255, 255));
        jLabel8.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("VS");
        panel3.add(jLabel8);
        jLabel8.setBounds(210, 10, 20, 15);

        Scrollable.add(panel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 580, 450, 100));

        panel2.setBackground(new java.awt.Color(255, 255, 255));
        panel2.setOpaque(false);
        panel2.setLayout(null);

        team13.setBackground(new java.awt.Color(255, 255, 255));
        team13.setFont(new java.awt.Font("Helvetica", 1, 14));
        team13.setForeground(new java.awt.Color(204, 204, 255));
        team13.setText("Team 1");
        team13.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team13.setAlignmentX(1.0F);
        panel2.add(team13);
        team13.setBounds(240, 10, 170, 15);

        loc2.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc2.setForeground(new java.awt.Color(153, 153, 153));
        loc2.setText("Location :");
        panel2.add(loc2);
        loc2.setBounds(110, 40, 200, 13);

        ref2.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref2.setForeground(new java.awt.Color(153, 153, 153));
        ref2.setText("Referree :");
        panel2.add(ref2);
        ref2.setBounds(110, 70, 200, 13);

        pic22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic22.setText("jLabel7");
        panel2.add(pic22);
        pic22.setBounds(380, 20, 60, 70);

        pic12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic12.setText("jLabel7");
        panel2.add(pic12);
        pic12.setBounds(10, 20, 60, 70);
        panel2.add(jSeparator3);
        jSeparator3.setBounds(-10, 90, 470, 12);

        team14.setBackground(new java.awt.Color(255, 255, 255));
        team14.setFont(new java.awt.Font("Helvetica", 1, 14));
        team14.setForeground(new java.awt.Color(204, 204, 255));
        team14.setText("Team 1");
        team14.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team14.setAlignmentX(1.0F);
        panel2.add(team14);
        team14.setBounds(40, 10, 170, 15);

        jLabel4.setBackground(new java.awt.Color(255, 255, 255));
        jLabel4.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("VS");
        panel2.add(jLabel4);
        jLabel4.setBounds(210, 10, 20, 15);

        Scrollable.add(panel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 480, 450, 100));

        panel1.setBackground(new java.awt.Color(255, 255, 255));
        panel1.setOpaque(false);
        panel1.setLayout(null);

        team11.setBackground(new java.awt.Color(255, 255, 255));
        team11.setFont(new java.awt.Font("Helvetica", 1, 14));
        team11.setForeground(new java.awt.Color(204, 204, 255));
        team11.setText("Team 1");
        team11.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team11.setAlignmentX(1.0F);
        panel1.add(team11);
        team11.setBounds(240, 10, 170, 15);

        loc1.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc1.setForeground(new java.awt.Color(153, 153, 153));
        loc1.setText("Location :");
        panel1.add(loc1);
        loc1.setBounds(110, 40, 200, 13);

        ref1.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref1.setForeground(new java.awt.Color(153, 153, 153));
        ref1.setText("Referree :");
        panel1.add(ref1);
        ref1.setBounds(110, 70, 200, 13);

        pic21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic21.setText("jLabel7");
        panel1.add(pic21);
        pic21.setBounds(380, 20, 60, 70);

        pic11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic11.setText("jLabel7");
        panel1.add(pic11);
        pic11.setBounds(10, 20, 60, 70);
        panel1.add(jSeparator2);
        jSeparator2.setBounds(-10, 90, 470, 12);

        team12.setBackground(new java.awt.Color(255, 255, 255));
        team12.setFont(new java.awt.Font("Helvetica", 1, 14));
        team12.setForeground(new java.awt.Color(204, 204, 255));
        team12.setText("Team 1");
        team12.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team12.setAlignmentX(1.0F);
        panel1.add(team12);
        team12.setBounds(40, 10, 170, 15);

        jLabel1.setBackground(new java.awt.Color(255, 255, 255));
        jLabel1.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("VS");
        panel1.add(jLabel1);
        jLabel1.setBounds(210, 10, 20, 15);

        Scrollable.add(panel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 380, 450, 100));

        panel4.setBackground(new java.awt.Color(255, 255, 255));
        panel4.setOpaque(false);
        panel4.setLayout(null);

        team17.setBackground(new java.awt.Color(255, 255, 255));
        team17.setFont(new java.awt.Font("Helvetica", 1, 14));
        team17.setForeground(new java.awt.Color(204, 204, 255));
        team17.setText("Team 1");
        team17.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team17.setAlignmentX(1.0F);
        panel4.add(team17);
        team17.setBounds(240, 10, 170, 15);

        loc4.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc4.setForeground(new java.awt.Color(153, 153, 153));
        loc4.setText("Location :");
        panel4.add(loc4);
        loc4.setBounds(110, 40, 200, 13);

        ref4.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref4.setForeground(new java.awt.Color(153, 153, 153));
        ref4.setText("Referree :");
        panel4.add(ref4);
        ref4.setBounds(110, 70, 200, 13);

        pic24.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic24.setText("jLabel7");
        panel4.add(pic24);
        pic24.setBounds(380, 20, 60, 70);

        pic14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic14.setText("jLabel7");
        panel4.add(pic14);
        pic14.setBounds(10, 20, 60, 70);
        panel4.add(jSeparator8);
        jSeparator8.setBounds(-10, 90, 470, 12);

        team18.setBackground(new java.awt.Color(255, 255, 255));
        team18.setFont(new java.awt.Font("Helvetica", 1, 14));
        team18.setForeground(new java.awt.Color(204, 204, 255));
        team18.setText("Team 1");
        team18.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team18.setAlignmentX(1.0F);
        panel4.add(team18);
        team18.setBounds(40, 10, 170, 15);

        jLabel9.setBackground(new java.awt.Color(255, 255, 255));
        jLabel9.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("VS");
        panel4.add(jLabel9);
        jLabel9.setBounds(210, 10, 20, 15);

        Scrollable.add(panel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 280, 450, 100));

        panel5.setBackground(new java.awt.Color(255, 255, 255));
        panel5.setOpaque(false);
        panel5.setLayout(null);

        team19.setBackground(new java.awt.Color(255, 255, 255));
        team19.setFont(new java.awt.Font("Helvetica", 1, 14));
        team19.setForeground(new java.awt.Color(204, 204, 255));
        team19.setText("Team 1");
        team19.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team19.setAlignmentX(1.0F);
        panel5.add(team19);
        team19.setBounds(240, 10, 170, 15);

        loc5.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc5.setForeground(new java.awt.Color(153, 153, 153));
        loc5.setText("Location :");
        panel5.add(loc5);
        loc5.setBounds(110, 40, 200, 13);

        ref5.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref5.setForeground(new java.awt.Color(153, 153, 153));
        ref5.setText("Referree :");
        panel5.add(ref5);
        ref5.setBounds(110, 70, 200, 13);

        pic25.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic25.setText("jLabel7");
        panel5.add(pic25);
        pic25.setBounds(380, 20, 60, 70);

        pic15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic15.setText("jLabel7");
        panel5.add(pic15);
        pic15.setBounds(10, 20, 60, 70);
        panel5.add(jSeparator10);
        jSeparator10.setBounds(-10, 90, 470, 12);

        team20.setBackground(new java.awt.Color(255, 255, 255));
        team20.setFont(new java.awt.Font("Helvetica", 1, 14));
        team20.setForeground(new java.awt.Color(204, 204, 255));
        team20.setText("Team 1");
        team20.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team20.setAlignmentX(1.0F);
        panel5.add(team20);
        team20.setBounds(40, 10, 170, 15);

        jLabel11.setBackground(new java.awt.Color(255, 255, 255));
        jLabel11.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("VS");
        panel5.add(jLabel11);
        jLabel11.setBounds(210, 10, 20, 15);

        Scrollable.add(panel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 180, 450, 100));

        panel6.setBackground(new java.awt.Color(255, 255, 255));
        panel6.setOpaque(false);
        panel6.setLayout(null);

        team21.setBackground(new java.awt.Color(255, 255, 255));
        team21.setFont(new java.awt.Font("Helvetica", 1, 14));
        team21.setForeground(new java.awt.Color(204, 204, 255));
        team21.setText("Team 1");
        team21.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team21.setAlignmentX(1.0F);
        panel6.add(team21);
        team21.setBounds(240, 10, 170, 15);

        loc6.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc6.setForeground(new java.awt.Color(153, 153, 153));
        loc6.setText("Location :");
        panel6.add(loc6);
        loc6.setBounds(110, 40, 200, 13);

        ref6.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref6.setForeground(new java.awt.Color(153, 153, 153));
        ref6.setText("Referree :");
        panel6.add(ref6);
        ref6.setBounds(110, 70, 200, 13);

        pic26.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic26.setText("jLabel7");
        panel6.add(pic26);
        pic26.setBounds(380, 20, 60, 70);

        pic16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic16.setText("jLabel7");
        panel6.add(pic16);
        pic16.setBounds(10, 20, 60, 70);
        panel6.add(jSeparator12);
        jSeparator12.setBounds(-10, 90, 470, 12);

        team22.setBackground(new java.awt.Color(255, 255, 255));
        team22.setFont(new java.awt.Font("Helvetica", 1, 14));
        team22.setForeground(new java.awt.Color(204, 204, 255));
        team22.setText("Team 1");
        team22.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team22.setAlignmentX(1.0F);
        panel6.add(team22);
        team22.setBounds(40, 10, 170, 15);

        jLabel13.setBackground(new java.awt.Color(255, 255, 255));
        jLabel13.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("VS");
        panel6.add(jLabel13);
        jLabel13.setBounds(210, 10, 20, 15);

        Scrollable.add(panel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 80, 450, 100));

        panel7.setBackground(new java.awt.Color(255, 255, 255));
        panel7.setOpaque(false);
        panel7.setLayout(null);

        team23.setBackground(new java.awt.Color(255, 255, 255));
        team23.setFont(new java.awt.Font("Helvetica", 1, 14));
        team23.setForeground(new java.awt.Color(204, 204, 255));
        team23.setText("Team 1");
        team23.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team23.setAlignmentX(1.0F);
        panel7.add(team23);
        team23.setBounds(240, 10, 170, 15);

        loc7.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc7.setForeground(new java.awt.Color(153, 153, 153));
        loc7.setText("Location :");
        panel7.add(loc7);
        loc7.setBounds(160, 40, 100, 13);

        ref7.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref7.setForeground(new java.awt.Color(153, 153, 153));
        ref7.setText("Referree :");
        panel7.add(ref7);
        ref7.setBounds(160, 70, 100, 13);

        pic27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic27.setText("jLabel7");
        panel7.add(pic27);
        pic27.setBounds(380, 20, 60, 70);

        pic17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic17.setText("jLabel7");
        panel7.add(pic17);
        pic17.setBounds(10, 20, 60, 70);
        panel7.add(jSeparator13);
        jSeparator13.setBounds(-10, 90, 470, 12);

        team24.setBackground(new java.awt.Color(255, 255, 255));
        team24.setFont(new java.awt.Font("Helvetica", 1, 14));
        team24.setForeground(new java.awt.Color(204, 204, 255));
        team24.setText("Team 1");
        team24.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team24.setAlignmentX(1.0F);
        panel7.add(team24);
        team24.setBounds(40, 10, 170, 15);

        jLabel14.setBackground(new java.awt.Color(255, 255, 255));
        jLabel14.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("VS");
        panel7.add(jLabel14);
        jLabel14.setBounds(210, 10, 20, 15);

        Scrollable.add(panel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 780, 450, 100));

        panel8.setBackground(new java.awt.Color(255, 255, 255));
        panel8.setOpaque(false);
        panel8.setLayout(null);

        team25.setBackground(new java.awt.Color(255, 255, 255));
        team25.setFont(new java.awt.Font("Helvetica", 1, 14));
        team25.setForeground(new java.awt.Color(204, 204, 255));
        team25.setText("Team 1");
        team25.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team25.setAlignmentX(1.0F);
        panel8.add(team25);
        team25.setBounds(240, 10, 170, 15);

        loc8.setFont(new java.awt.Font("Helvetica", 1, 13));
        loc8.setForeground(new java.awt.Color(153, 153, 153));
        loc8.setText("Location :");
        panel8.add(loc8);
        loc8.setBounds(110, 40, 200, 13);

        ref8.setFont(new java.awt.Font("Helvetica", 1, 13));
        ref8.setForeground(new java.awt.Color(153, 153, 153));
        ref8.setText("Referree :");
        panel8.add(ref8);
        ref8.setBounds(110, 70, 200, 13);

        pic28.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic28.setText("jLabel7");
        panel8.add(pic28);
        pic28.setBounds(380, 20, 60, 70);

        pic18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/uefa/1.FC-Kaiserslautern.png"))); // NOI18N
        pic18.setText("jLabel7");
        panel8.add(pic18);
        pic18.setBounds(10, 20, 60, 70);
        panel8.add(jSeparator14);
        jSeparator14.setBounds(-10, 90, 470, 12);

        team26.setBackground(new java.awt.Color(255, 255, 255));
        team26.setFont(new java.awt.Font("Helvetica", 1, 14));
        team26.setForeground(new java.awt.Color(204, 204, 255));
        team26.setText("Team 1");
        team26.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        team26.setAlignmentX(1.0F);
        panel8.add(team26);
        team26.setBounds(40, 10, 170, 15);

        jLabel15.setBackground(new java.awt.Color(255, 255, 255));
        jLabel15.setFont(new java.awt.Font("Helvetica", 1, 14));
        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("VS");
        panel8.add(jLabel15);
        jLabel15.setBounds(210, 10, 20, 15);

        Scrollable.add(panel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 680, 450, 100));

        jLabel16.setBackground(new java.awt.Color(0, 0, 0));
        jLabel16.setText("jLabel10");
        jLabel16.setOpaque(true);
        Scrollable.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 620, 1400));

        jScrollPane1.setViewportView(Scrollable);

        add(jScrollPane1);
        jScrollPane1.setBounds(90, 70, 620, 800);

        jLabel12.setBackground(new java.awt.Color(0, 0, 0));
        jLabel12.setText("jLabel10");
        jLabel12.setOpaque(true);
        add(jLabel12);
        jLabel12.setBounds(90, 70, 620, 1400);
        add(jPanel2);
        jPanel2.setBounds(0, 0, 10, 10);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Scrollable;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator10;
    private javax.swing.JSeparator jSeparator11;
    private javax.swing.JSeparator jSeparator12;
    private javax.swing.JSeparator jSeparator13;
    private javax.swing.JSeparator jSeparator14;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JSeparator jSeparator8;
    private javax.swing.JSeparator jSeparator9;
    private javax.swing.JLabel loc1;
    private javax.swing.JLabel loc2;
    private javax.swing.JLabel loc3;
    private javax.swing.JLabel loc4;
    private javax.swing.JLabel loc5;
    private javax.swing.JLabel loc6;
    private javax.swing.JLabel loc7;
    private javax.swing.JLabel loc8;
    private javax.swing.JPanel panel1;
    private javax.swing.JPanel panel2;
    private javax.swing.JPanel panel3;
    private javax.swing.JPanel panel4;
    private javax.swing.JPanel panel5;
    private javax.swing.JPanel panel6;
    private javax.swing.JPanel panel7;
    private javax.swing.JPanel panel8;
    private javax.swing.JLabel pic11;
    private javax.swing.JLabel pic12;
    private javax.swing.JLabel pic13;
    private javax.swing.JLabel pic14;
    private javax.swing.JLabel pic15;
    private javax.swing.JLabel pic16;
    private javax.swing.JLabel pic17;
    private javax.swing.JLabel pic18;
    private javax.swing.JLabel pic21;
    private javax.swing.JLabel pic22;
    private javax.swing.JLabel pic23;
    private javax.swing.JLabel pic24;
    private javax.swing.JLabel pic25;
    private javax.swing.JLabel pic26;
    private javax.swing.JLabel pic27;
    private javax.swing.JLabel pic28;
    private javax.swing.JLabel ref1;
    private javax.swing.JLabel ref2;
    private javax.swing.JLabel ref3;
    private javax.swing.JLabel ref4;
    private javax.swing.JLabel ref5;
    private javax.swing.JLabel ref6;
    private javax.swing.JLabel ref7;
    private javax.swing.JLabel ref8;
    private javax.swing.JLabel team11;
    private javax.swing.JLabel team12;
    private javax.swing.JLabel team13;
    private javax.swing.JLabel team14;
    private javax.swing.JLabel team15;
    private javax.swing.JLabel team16;
    private javax.swing.JLabel team17;
    private javax.swing.JLabel team18;
    private javax.swing.JLabel team19;
    private javax.swing.JLabel team20;
    private javax.swing.JLabel team21;
    private javax.swing.JLabel team22;
    private javax.swing.JLabel team23;
    private javax.swing.JLabel team24;
    private javax.swing.JLabel team25;
    private javax.swing.JLabel team26;
    // End of variables declaration//GEN-END:variables


    /* Fills the game panels with the games received from the database
     */
    public void fillGames(String[] tokens){

//        JLabel[] la = {team11, team21, loc1, ref1, pic11, pic12, team21, team22, loc2, ref2, pic12, pic22,
//        team13, team23, loc3, ref3, pic13, pic23, team14, team24, loc4, ref4, pic14, pic24, team15, team25,
//        loc5, ref5, pic15, pic25, team16, team26, loc6, ref6, pic16, pic26, team17, loc7, ref7, pic17, pic27,
//        team18 , loc8, ref8, pic18, pic28};

        JLabel [] la = {
        team16,team15,loc3,ref3,pic13,pic23,
        team14,team13,loc2,ref2,pic12,pic22,
        team12,team11,loc1,ref1,pic11,pic21,
        team18,team17,loc4,ref4,pic14,pic24,
        team20,team19,loc5,ref5,pic15,pic25,
        team22,team21,loc6,ref6,pic16,pic26,
        team24,team23,loc7,ref7,pic17,pic27,
        team26,team25,loc8,ref8,pic18,pic28};
        JPanel[] pa = {panel1, panel2, panel3, panel4, panel5, panel6, panel7, panel8};

        int n = Integer.parseInt(tokens[1]);
        int j = 0;

        System.out.println("Found " + n + "current games");
        System.out.println("Is this right? Check");

        for (j=0;j<n;j++){

//            System.out.println(la[0+j*6].getText());
//            System.out.println("Team 1: "+tokens[11*j+3]);
//            System.out.println(la[1+j*6].getText());
//            System.out.println("Team 2: "+tokens[11*j+4]);

            la[0+j*6].setHorizontalAlignment(JLabel.CENTER);
            la[0+j*6].setVerticalAlignment(JLabel.CENTER);
            la[0+j*6].setText(tokens[11*j+3]);
            la[1+j*6].setText(tokens[11*j+4]); //set to team1 vs team2
            la[2+j*6].setText(tokens[11*j+5]); // set to Location
            la[3+j*6].setText(tokens[11*j+8]); // set to Referree
            //Set images?
  //          pa[j].setVisible(true);
        }

        for (j=n;j<8;j++)
            pa[j].setVisible(false);


    }

}
